#include <REGX52.H>
#include "Pin.h"

extern unsigned int T0count;
extern unsigned int rate;


void PWM_Control(){
	switch(rate){
		case 0:
			Motor = 0;
		break;
		case 1:
			Motor = (T0count % 2) ? 1 : 0;
		break;
		case 2:
			Motor = (T0count % 3) ? 1 : 0;
		break;
		case 3:
			Motor = (T0count % 9) ? 1 : 0;
		break;
	}
}